CPLUS		= g++
CPPFLAGS	= -g -Wall -Werror -finput-charset=GBK
CPPOPTIONS  = -D_LANG_CH_US -D_XPG4_EXTENDED -D__unix -D_LINUX_ -D_DEBUG_
RM			= rm -f
LINKS		= -ldb -lpthread -lrt
EXE			= bdbbase.out 
OBJS		= BdbBase.o \
			  main.o

#Directory Setting
#ORACLE_INC	= $(ORACLE_HOME)/rdbms/public
#ORACLE_LIB	= $(ORACLE_HOME)/lib
BERKDB_INC  = /usr/local/BerkeleyDB.5.2/include
BERKDB_LIB  = /usr/local/BerkeleyDB.5.2/lib
INCLUDE		= -I$(BERKDB_INC)
LIBS		= -L$(BERKDB_LIB)
#objection
all:$(EXE)
#Rely on Rules
$(EXE):$(OBJS)
	$(CPLUS)   $(OBJS) $(LIBS) -o $@  $(LINKS)
#Auto Dependencies
%.o:%.cpp
	$(CPLUS) $(INCLUDE) $(CPPFLAGS) -c $< $(CPPOPTIONS)
#Clean Phony Targets
.PHONY:clean
clean:
	$(RM) $(OBJS)
	$(RM) $(EXE)
